<?php
include $this->Render('header.php');
?>
<style type="text/css">  
    #div_main {  
        width: 700px;  
        height: 400px;  
        margin-left: 10px;  
    }  

    #div_button{
    	margin-top: 50px;
    	margin-left: 480px;
    }
    #div_txt {  
        position: relative;  
        width: 200px;   
    }  

    #txt1 {  
        width: 99%;  
    }  

    #div_items {  
        position: relative;  
        width: 398px;  
        height: 100px;  
        border: 1px solid #66afe9;  
        border-top: 0px;  
        overflow: auto;  
        display: none;  
    }  

    .div_item {  
        width: 100%;  
        height: 20px;  
        margin-top: 1px;  
        font-size: 13px;  
        line-height: 20px;  
    }  
</style>  
<link rel="stylesheet" type="text/css" href="<?php echo BASE_STYLE;?>/css/admin.css" />
<script type="text/javascript" src="<?php echo BASE_STYLE;?>/js/common.js"></script>

<div id="div_main">  
	<form class="login-box-form J-ajaxForm" action="/bank/operate/option/banksave/" method="post" autocomplete="off">
	<div class="tongrong-box-main">
    	<table width="100%" cellpadding="0" cellspacing="0" border="0">
    		<tr height="50px"></tr>
        	<tr>
            	<td width="90px" height="30">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当前银行：</td>
                <td><?php echo $this->msg['bk_name'];?>
                </td>
            </tr>
            <tr height="35px"></tr>
            <tr>
            	<td valign="top">需开通网点名：</td>
                <td height="30px" valign="top">
                	<div id="div_txt"><input type="text" id="txt1" style="width:400px;height:20px" name="br_name">
                    <div id="div_items">
                    <?php for($i=0;$i<count($this->br_msg);$i++){
                    	echo '<div class="div_item">'.$this->br_msg[$i].'</div>';
                    }  ?>
                </div>  
            </div>  
                </td>
            </tr>
        </table>
    </div>
    <div id="div_button">
    	<input type="hidden" name="bk_id" value="<?php echo $this->msg['bk_id'];?>" />
    	<input class="btn-submit-blue fn-left mr15 J-submit" type="submit" value="提交" />
        <a class="a-btn-close J-a-btn-close" href="javascript:;">关闭</a>
    </div>
	</form>
	    </div> 

<script>
	//关闭弹出
	$(".J-a-btn-close").on('click',function(){
		var winElement = parent.Ext.fly(window.frameElement).up('div.x-window');
		parent.Ext.getCmp(winElement.id).close();
		
	});
	$(document).ready(function(e) {
        $(".J-submit").on('click',function(){
			$(this).dyhlForm({
				beforefunction:chk,
				nofunction:function(){
					$(".J-submit").prop('disabled',false);
				},
				sucessfunction:function(data){
					$(".J-submit").prop('disabled',false);
					if(data['success']){
						Ext.Msg.alert('提示','开通成功',function(){
							window.parent.location.reload();
                            var winElement = parent.Ext.fly(window.frameElement).up('div.x-window');
                            parent.Ext.getCmp(winElement.id).close();
						});
						//window.location.reload();
					}else{
						Ext.Msg.alert('提示',data['msg']);
					}
				}	
			});	
		});
    });

    function chk(){
	    $(".J-submit").prop('disabled',true);	
	}
</script>
<script type="text/javascript">  
  
    //弹出列表框  
    $("#txt1").click(function () {  
        $("#div_items").css('display', 'block');  
        return false;  
    });  
  
    //隐藏列表框  
    $("body").click(function () {  
        $("#div_items").css('display', 'none');  
    });  
  
    //移入移出效果  
    $(".div_item").hover(function () {  
        $(this).css('background-color', '#1C86EE').css('color', 'white');  
    }, function () {  
        $(this).css('background-color', 'white').css('color', 'black');  
    });  
  
    //文本框输入  
    $("#txt1").keyup(function () {  
        $("#div_items").css('display', 'block');//只要输入就显示列表框  
  
        if ($("#txt1").val().length <= 0) {  
            $(".div_item").css('display', 'block');//如果什么都没填，跳出，保持全部显示状态  
            return;  
        }  
  
        $(".div_item").css('display', 'none');//如果填了，先将所有的选项隐藏  
  
        for (var i = 0; i < $(".div_item").length; i++) {  
            //模糊匹配，将所有匹配项显示  
            if ($(".div_item").eq(i).text().indexOf($("#txt1").val()) > -1) {  
                $(".div_item").eq(i).css('display', 'block');  
            }  
        }  
    });  
  
    //项点击  
    $(".div_item").click(function () {  
        $("#txt1").val($(this).text());  
    });  
  
</script>  
<?php include $this->Render('footer.php'); ?>